package araxy.blog.service;

import araxy.blog.entity.User;
import araxy.blog.exception.LoginException;
import araxy.blog.exception.TokenException;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;

import java.util.List;

public interface UserService {
    public boolean addUser(String username,String password,String nickname);
    public boolean addUser(String username,String password,String nickname,Boolean isAdministrator);
    public Object loginAuth(Subject subject, UsernamePasswordToken usernamePasswordToken);
    public Object tokenAuth(String token) throws TokenException, LoginException, JsonProcessingException;
    public Object passwordAuth(String username,String password) throws LoginException, TokenException, JsonProcessingException;
    public Integer countAllAdmin();
    public boolean updateUser(User user);

    List<User> getAll();
}
